import { request} from '@/utils/request.util';
import type { Pagination } from '@/types/pagination';
import type { Response, Res } from '@/types/common';

import type { StorageListResponse ,FormStorage,StorageResponse } from '@/types/storage/index';

//查询药库列表
export const getStorageList =  (body:Pagination) => request.get<StorageResponse> ("/stock/supply/getStorageList", {
  params: body
});  
//新增药库
export const addStorage = (body: FormStorage) => request.post<Response<Res>>("/stock/supply/addStorage", body);
//编辑药库
export const updateStorage = (body: FormStorage) => request.post<Response<Res>>("/stock/supply/updateStorage", body);
//删除药库
export const deleteStorage = (storageId: number) => request.post<Response<Res>>("/stock/supply/deleteStorage", { storageId });
//启用药库
export const enableStorage = (storageId: number) => request.post<Response<Res>>("/stock/supply/enableStorage", { storageId });
//停用药库
export const disableStorage = (storageId: number) => request.post<Response<Res>>("/stock/supply/disableStorage", { storageId });  
//设置默认药库
export const setDefault = (storageId: number) => request.post<Response<Res>>("/stock/supply/setDefault", { storageId });  